﻿using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using CommandLine;
using Imgur.Net;

namespace GurLoader.CommandLineOptions
{
    [Verb("SendAlbum", HelpText = "Send an album of 1 or more images to Imgur.")]
    public class SendAlbumOptions : ICommandLineOptions
    {
        [Value(0, Required = true)]
        public IEnumerable<string> Files { get; set; }

        [Option('t', "title", Required = false, HelpText = "Title to use for the album.")]
        public string Title { get; set; }

        [Option('d', "description", Required = false, HelpText = "Description of the album.")]
        public string Description { get; set; }

        [Option('l', "layoutstyle", Required = false, HelpText = "Layout style of the album. ( blog, grid, horizontal or vertical)")]
        public LayoutStyle LayoutStyle { get; set; }

        [Option('r', "registereduser", Required = false, HelpText = "Use a registered Imgur account to upload content. If missing data will be sent anonymously.")]
        public bool RegisteredUserAccount { get; set; }

        public Command CommandAction
        {
            get { return Command.SendAlbum; }
        }

        public void Validate()
        {
            if ( Files == null || !Files.Any())
                throw new Exception("No files specified.");
        }
    }
}